﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SFast.Web;
using SolutionModel;
using SolutionBLL;
using SFast;

public partial class admin_newsSystem_CommonClass_Detail : System.Web.UI.Page
{

    protected String btn_text = "确  定";

    protected void Page_Load(object sender, EventArgs e)
    {
        btn_text = "提  交";
        this.fun.Value = "Load_onSave";  //当点击按时要执行的方法
    }

    #region 事件： 编辑Load
    /// <summary>
    /// 编辑时加载
    /// </summary>
    public void EditLoad()
    {
        btn_text = "保  存";
        this.fun.Value = "EditLoad_onSave";  //当点击按时要执行的方法
    }
    #endregion

    #region ui事件 新建保存
    /// <summary>
    /// 新建时保存
    /// </summary>
    public String Load_onSave()
    {
        CommonClass ccl= Request._GetForm<CommonClass>();
        CommonClassBLL bll = new CommonClassBLL();
        MessageInfoByFormModel sim = bll.Insert(ccl);
        return sim._ToJsonStr();
    }
    #endregion

    #region ui事件：编辑保存
    /// <summary>
    /// 编辑时保存
    /// </summary>
    public String EditLoad_onSave()
    {
        CommonClass ccl = Request._GetForm<CommonClass>();
        CommonClassBLL bll = new CommonClassBLL();
        MessageInfoByFormModel sim = bll.Update(ccl);
        return sim._ToJsonStr();
    }

    #endregion

    public String validUserName()
    {
        return "n";
    }
}